#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

//判断是否为闰年

//int main()
//{
//	int year = 0;
//	int count = 0;
//	for (year = 1; year <= 2000; year++)
//	{
//		if (((year % 4 == 0) &&(year % 100 != 0)) || (year % 400 == 0))
//		{
//			printf("%d\n", year);
//			count++;
//		}
//	}
//	printf("%d\n", count);
//}


//函数实现整形有序数组的二分查找

int modle_look(int x, char arr[],int ch)//数组arr传到函数时。实际上只是将arr的第一个地址传过来，所以这里的arr是一个指针变量
{
	
	int left = 0;
	int right = ch - 1;
	int mid = (right - left) / 2 + left;
	while (left <= right)
	{
		int mid = (right - left) / 2 + left;
		if (arr[mid] < x)
		{
			left = mid + 1;	
		}
		else if (arr[mid] > x)
		{
			right = mid - 1;	
		}
		else
		{
			return mid;
		}	
	}
	return -1;
}

int main()
{
	char arr[] = { 1,2,3,4,5,6,7,8,9,10 };
	int n = 0;
	int ch = sizeof(arr) / sizeof(arr[0]);
	
	scanf("%d", &n);
	int a = modle_look(n, arr,ch);
	
	if (a == -1)
	{
		printf("找不到\n");
	}
	else
	{
		printf("下标是%d\n",a);
	}
	return 0;
}